package com.gosophia.unit;

import java.util.List;



import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
import org.jbpm.context.exe.ContextInstance;
import org.jbpm.db.GraphSession;
import org.jbpm.graph.def.ProcessDefinition;
import org.jbpm.graph.exe.ProcessInstance;
import org.jbpm.graph.exe.Token;
import org.junit.Test;

public class UTCreateTable {

	JbpmContext jbpmContext;
 
	/**
	 * 部署流程
	 */
	@Test
	public void testDeployProcess_1(){

			
		//获取连接数据库配置文件
		JbpmConfiguration config=JbpmConfiguration.getInstance("jbpm.cfg.xml");
		//加载流程
//		ProcessDefinition process1=new ProcessDefinition().parseXmlResource("CreateCycle/processdefinition.xml");
		ProcessDefinition process2=new ProcessDefinition().parseXmlResource("reportProcess/processdefinition.xml");
		ProcessDefinition process3=new ProcessDefinition().parseXmlResource("govDocProcess/processdefinition.xml");
		ProcessDefinition process4=new ProcessDefinition().parseXmlResource("conference/processdefinition.xml");
		//获取上下文
		JbpmContext jbpmContext=config.createJbpmContext();
		try{
		//部署流程
//		jbpmContext.deployProcessDefinition(process1);
		jbpmContext.deployProcessDefinition(process2);
		jbpmContext.deployProcessDefinition(process3);
		jbpmContext.deployProcessDefinition(process4);
		}finally{
			jbpmContext.close();
		}
		
	}
	
	 
}
